package com.javastart;

import com.javastart.service.SomeService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
        System.out.println( "Hello World!" );

        //传统的做法
        //SomeService service=new SomeServiceImpl();
        //service.doSome();

        //指定配置文件
        String config="beans.xml";
        ApplicationContext ctx=new ClassPathXmlApplicationContext(config);
        SomeService service=(SomeService) ctx.getBean("SomeService");
        service.doSome();
    }
}
